knitr::opts_chunk$set(echo = TRUE)
library(bupaR)
library(edeaR)
library(processmonitR)
library(plotluck)
library(DiagrammeR)
library(data.table)
#library(DiagrammeRsvg)

csvLog<-read.table("../Motivation.csv",header = TRUE, sep = ";",na = c("n.v.t.","onbekend",""))
csvLog$status = "complete"
csvLog$activity_instance = 1:nrow(csvLog)
csvLog$timestamp<-as.POSIXct(strptime(csvLog$Timestamp, "%d-%m-%Y"))


kolomNamen<-colnames(csvLog)
csvLog$activity_instance = 1:nrow(csvLog)
csvLog$status<-"start"
csvLog$SentimentGem <- as.numeric(csvLog$SentimentGem)

Gevonden kolomkoppen:

colnames(csvLog)

Omzetten naar een processmining Log

if (!("Werknemer" %in% colnames(csvLog))){csvLog$Werknemer<-NA}
eventLog.Base<-eventlog(csvLog,
        case_id = "CaseNr",
        activity_id = "Motivatie_totaal",
        activity_instance_id = "activity_instance",
        lifecycle_id = "status",
        timestamp = "timestamp",
        resource_id = "SentimentGem"
    )

Map met standaard functie

graphStandaard <- process_map(eventLog.Base, type = performance(),render = FALSE )
graphStandaard %>%
    export_graph(file_name = "Z:/Dump/mapMetStandaardFunctie.svg",  file_type = "SVG")

Map met SentimentGem

fileName <- "SentimentGem"
agregationInst = list( enriched_frequency(value = "absolute", columnName = "aantal"),enriched_column_aggregate( FUN = mean, columnNameIn = "SentimentGem", columnNameOut = "SentimentGem", edgeOperation = "to") )
map<-enriched_process_map(eventLog.Base, aggregationInstructions = agregationInst )
map <- map %>%
    processmapR::color_activities( column = "SentimentGem",
                      colorCaption = "black",
                      colorUpperbound = "deeppink",
                      colorLowerbound = "green1") %>%
    label_activities(columns =c("activity_name","SentimentGem")) %>%
          color_transitions(column = "SentimentGem",
          colorCaption = "black",
          colorUpperbound = "deeppink",
          colorLowerbound = "darkgreen") %>%
    label_transitions(columns = c("SentimentGem")) 

x<- get_node_df(map)

map %>% export_graph(file_name = "Z:/Dump/SentimentGem.svg",  file_type = "SVG")




wfeijen/Uitbreiden_ProcessMap documentation built on May 28, 2019, 1:23 p.m.